#include <QApplication>
#include <QPushButton>
#include <QLabel>

int main (int argc, char **argv)
{
	//创建应用程序对象
	QApplication app (argc, argv);
	
	QLabel label ("我是一个标签");
	QPushButton button ("我是一个按钮");
	label.show ();
	button.show ();
	
	//点击按钮关闭标签
	//QObject::connect (&button, SIGNAL(clicked()), &label, SLOT(close()));
	//QObject::connect (&button, SIGNAL(clicked()), &app, SLOT(closeAllWindows()));
	QObject::connect (&button, SIGNAL(clicked()), &app, SLOT(quit()));

	//进入应用程序循环
	app.exec ();
}
